import request from '@/utils/request'

// 查询代理管理分页
export function getBsAgentPage(query) {
  return request({
    url: '/bsAgent/getPage',
    method: 'get',
    params: query
  })
}

// 查询代理管理列表
export function getBsAgentList(query) {
  return request({
    url: '/bsAgent/getList',
    method: 'get',
    params: query
  })
}

// 通过主键查询代理管理详细
export function getBsAgentById(query) {
  return request({
    url: '/bsAgent/getById',
    method: 'get',
    params: query
  })
}

// 新增或修改代理管理信息
export function addOrUpdateBsAgent(data) {
  return request({
    url: '/bsAgent/saveOrUpdate',
    method: 'post',
    data: data
  })
}

// 删除代理管理记录
export function delBsAgent(ids) {
  return request({
    url: '/bsAgent/deleteByIds/'+ids,
    method: 'delete',
  })
}

// 导出代理管理数据
export function exportBsAgent(query) {
  return request({
    url: '/bsAgent/export',
    method: 'get',
    params: query
  })
}

// 用户密码重置
export function resetAgentPwd(id, agentPhone, password) {
    const data = {
        id,
        agentPhone,
        password
    }
    return request({
        url: '/bsAgent/resetAgentPwd',
        method: 'put',
        data: data
    })
}
